package Thread_communication;

public class Deposit extends Thread{
    private Account acc;

    public Deposit(String n, Account a){
        super(n);
        this.acc = a;
    }


    @Override
    public void run() {
        super.run();
        while (true){
            acc.DepositMoney(100000);
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }


    public Account getAcc() {
        return acc;
    }

    public void setAcc(Account acc) {
        this.acc = acc;
    }
}
